<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'article-form',
	'enableAjaxValidation'=>false,
	'htmlOptions' => array('enctype' => 'multipart/form-data' )
)); 
?>
	<div class="line">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title', array('maxlength'=>'80', 'class'=>'medium')); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'update_time'); ?>
		<?php echo $form->textField($model,'update_time',array('class'=>'datepicker', 'value'=>$this->formateDate($model->update_time, false))); ?>
		<?php echo $form->error($model,'update_time'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'material_category_id'); ?>
		<?php echo $form->dropDownList($model,'material_category_id', CHtml::listData(ArticleCategory::model()->findAll(), 'id', 'title')); ?>
		<?php echo $form->error($model,'material_category_id'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'content'); ?>
		<?php echo $form->textArea($model,'content', array('class'=>'wysiwyg')); ?>
		<?php echo $form->error($model,'content'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'content_short'); ?>
		<?php echo $form->textArea($model,'content_short', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'content_short'); ?>
	</div>
	
	<div class="line">
		<?php echo $form->labelEx($model,'tags'); ?>
		<?php echo $form->textArea($model,'tags', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'tags'); ?>
	</div>
			
	
	<div class="line">
		<?php echo $form->labelEx($model,'author_id'); ?>
		<?php echo $form->dropDownList($model,'author_id', CHtml::listData(User::model()->findAll(), 'id', 'username')); ?>
		<?php echo $form->error($model,'author_id'); ?>
	</div>
	
	<div class="line">	
		<?
			$this->widget('pictures.components.PicturesEditor',
				      array('mode' =>'AddAjax',
				          'files' => $model->isNewRecord ? false : $model->getFiles(),
				          'oneImage'=>true
			));
		?>
	</div>
	
	<div class="line">
		<p class="note">Поля помеченные <span class="required">*</span> обязательны для заполнения.</p>
	</div>
	<div class="line button">
		<div class="line button">		
			<button type="submit" class="green big"><span><?= $model->isNewRecord ? Yii::t('app', 'Добавить') : Yii::t('app', 'Сохранить'); ?></span></button>
			<button type="button" onclick="window.location.href=' <?=Yii::app()->request->getUrl(); ?>'" class="green big"><span><?= Yii::t('app', 'Отмена'); ?></span></button>
		</div>
	</div>
<?php $this->endWidget(); ?>
